<article class="" id="post-">
<header class="entry-header">
<h1 class="entry-title">jQuery.dequeue()</h1>
<div class="entry-meta">
						所属分类：<span class="category"><a href="/category/data/">数据操作</a></span><span class="category-divider"> | </span><span class="category"><a href="/category/utilities/">工具类</a></span>
<span class="pull-right">英文文档：<a href="https://api.jquery123.com/jQuery.dequeue/" target="_blank">jQuery.dequeue()</a></span>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<!-- .entry-header -->
<div class="entry-content">
<article class="entry method" id="jQuery-dequeue1"><h2 class="section-title">
<span class="name">jQuery.dequeue( element [, queueName ] )</span><span class="returns">返回: <a href="/Types/#undefined">undefined</a></span>
</h2>
<div class="entry-wrapper">
<p class="desc"><strong>描述: </strong>在匹配的元素上执行队列中的下一个函数。</p>
<ul class="signatures"><li class="signature" id="jQuery-dequeue-element-queueName">
<h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.3/">1.3</a></span>jQuery.dequeue( element [, queueName ] )</h4>
<ul>
<li>
<div><strong>element</strong></div>
<div>类型: <a href="/Types/#Element">Element</a>
</div>
<div>一个用于移除和执行列队的DOM元素。</div>
</li>
<li>
<div><strong>queueName</strong></div>
<div>类型: <a href="/Types/#String">String</a>
</div>
<div>一个含有队列名的字符串。默认是<code>fx</code>，标准的动画队列。</div>
</li>
</ul>
</li></ul>
<div class="longdesc" id="entry-longdesc">
<p><strong>注意</strong>这是一个底层的方法，你应该用<code><a href="/dequeue">.dequeue()</a></code>代替。 </p>
<p>当<code>.dequeue()</code>被调用的时候，列队中的下一个函数将从这个列队中被移除，然后再执行。这个函数应当在内部直接或间接调用 jQuery.dequeue()，以便队列得以继续执行下去。
			</p>
</div>
<section class="entry-examples" id="entry-examples"><header><h2 class="underline">例子:</h2></header><div class="entry-example" id="example-0">
<h4><span class="desc">使用 jQuery.dequeue() 来结束一个自定义队列函数，以便能够让队列继续运行下去。</span></h4>
<div class="syntaxhighlighter xml ">
<table>
<tbody>
<tr>
<td class="gutter">
<div class="line n1">1</div>
<div class="line n2">2</div>
<div class="line n3">3</div>
<div class="line n4">4</div>
<div class="line n5">5</div>
<div class="line n6">6</div>
<div class="line n7">7</div>
<div class="line n8">8</div>
<div class="line n9">9</div>
<div class="line n10">10</div>
<div class="line n11">11</div>
<div class="line n12">12</div>
<div class="line n13">13</div>
<div class="line n14">14</div>
<div class="line n15">15</div>
<div class="line n16">16</div>
<div class="line n17">17</div>
<div class="line n18">18</div>
<div class="line n19">19</div>
<div class="line n20">20</div>
<div class="line n21">21</div>
<div class="line n22">22</div>
<div class="line n23">23</div>
<div class="line n24">24</div>
<div class="line n25">25</div>
</td>
<td class="code">
<pre><div class="container"><div class="line"><code><span class="doctype">&lt;!DOCTYPE html&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">html</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="tag">&lt;<span class="title">style</span>&gt;</span><span class="css"><span class="tag">div</span> <span class="rules">{</span></span></code></div></div><div class="container"><div class="line"><code>  <span class="rule"><span class="attribute">margin</span>:<span class="value"><span class="number">3</span>px;</span></span> <span class="rule"><span class="attribute">width</span>:<span class="value"><span class="number">50</span>px;</span></span> <span class="rule"><span class="attribute">position</span>:<span class="value">absolute;</span></span></code></div></div><div class="container"><div class="line"><code>  <span class="rule"><span class="attribute">height</span>:<span class="value"><span class="number">50</span>px;</span></span> <span class="rule"><span class="attribute">left</span>:<span class="value"><span class="number">10</span>px;</span></span> <span class="rule"><span class="attribute">top</span>:<span class="value"><span class="number">30</span>px;</span></span></code></div></div><div class="container"><div class="line"><code>  <span class="rule"><span class="attribute">background-color</span>:<span class="value">yellow;</span></span></code></div></div><div class="container"><div class="line"><code><span class="rule">}</span></code></div></div><div class="container"><div class="line"><code><span class="tag">div</span><span class="class">.red</span> <span class="rules">{ <span class="rule"><span class="attribute">background-color</span>:<span class="value">red;</span></span> <span class="rule">}</span></span>  <span class="tag">&lt;/<span class="title">style</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"https://code.jquery.com/jquery-latest.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">body</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="tag">&lt;<span class="title">button</span>&gt;</span>Start<span class="tag">&lt;/<span class="title">button</span>&gt;</span>  <span class="tag">&lt;<span class="title">div</span>&gt;</span><span class="tag">&lt;/<span class="title">div</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span>&gt;</span><span class="javascript">$(<span class="string">"button"</span>).click(<span class="function"><span class="keyword">function</span> <span class="params">()</span> {</span></span></code></div></div><div class="container"><div class="line"><code>  $(<span class="string">"div"</span>).animate({left:<span class="string">'+=200px'</span>}, <span class="number">2000</span>);</code></div></div><div class="container"><div class="line"><code>  $(<span class="string">"div"</span>).animate({top:<span class="string">'0px'</span>}, <span class="number">600</span>);</code></div></div><div class="container"><div class="line"><code>  $(<span class="string">"div"</span>).queue(<span class="function"><span class="keyword">function</span> <span class="params">()</span> {</span></code></div></div><div class="container"><div class="line"><code>    $(<span class="keyword">this</span>).toggleClass(<span class="string">"red"</span>);</code></div></div><div class="container"><div class="line"><code>     $.dequeue( <span class="keyword">this</span> );</code></div></div><div class="container"><div class="line"><code>          });</code></div></div><div class="container"><div class="line"><code>  $(<span class="string">"div"</span>).animate({left:<span class="string">'10px'</span>, top:<span class="string">'30px'</span>}, <span class="number">700</span>);</code></div></div><div class="container"><div class="line"><code>});<span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">body</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">html</span>&gt;</span></code></div></div></pre>
</td>
</tr>
</tbody>
</table>
</div>
<h4>Demo:</h4>
<div class="demo code-demo"></div>
</div></section>
</div></article> </div>
</article>